package com.egghiro.framework.j2se.game.core.view.canvas;

import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

public class SGameCanvas extends DoubleBufferCanvas implements IScreen, IFrameObserver {
    public SGameCanvas(int width, int height) {
        super(width, height);
    }

    /**
     * 设置自身为KeyListener
     */
    public void setKeyListener() {
        removeKeyListener(this);
        addKeyListener(this);
    }

    public void mouseClicked(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mouseEntered(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mouseExited(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mousePressed(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mouseReleased(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mouseDragged(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void mouseMoved(MouseEvent e) {
        // TODO Auto-generated method stub

    }

    public void keyPressed(KeyEvent e) {
        // TODO Auto-generated method stub
    }

    public void keyReleased(KeyEvent e) {
        // TODO Auto-generated method stub
    }

    public void keyTyped(KeyEvent e) {
        // TODO Auto-generated method stub

    }

    public void focusGained(FocusEvent e) {
        // TODO Auto-generated method stub

    }

    public void focusLost(FocusEvent e) {
        // TODO Auto-generated method stub

    }

    @Override
    public void paint(SGraphics g) {
        g.clearRect(0, 0, getWidth(), getHeight());
    }

    public void updateFrame() {
        // Default implement
        updateDoubleBuffer();
    }
}
